function quickSort(arr=[]){
    let {length} = arr;
    if(length <= 1){
        return arr
    }
    let prvot = arr[0];//基准数
    let left = [];
    let right = [];
    for(let i = 1 ; i < length ; i++){
        if(arr[i] > prvot){
            right.push(arr[i]) 
        }else{
            left.push(arr[i])
        }
    }
    //递归调用
    let l = quickSort(left);
    let r = quickSort(right);
    return l.concat(prvot).concat(r)
}
console.log(quickSort([4,1,5,7,9,3,4,6]))